//
//  WJVideoPlayView.h
//  WJBSApp
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 王景伟. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger,TLC_AVPlayerStatues){
    TLC_PlayerStatusReadyToPlay,
    TLC_PlayerStatusFailed,
    TLC_PlayerStatusUnknown,
    TLC_PlayerStatusPlayEnd,
};

@class WJVideoPlayView;

@protocol XCAVPlayerDelegate <NSObject>

/** 播放器状态改变 */
- (void)tlc_AVPlayerView:(WJVideoPlayView *)playerView reloadStatuesChanged:(TLC_AVPlayerStatues)tlc_PlayerStatues;

/** 播放时间进度改变 */
- (void)tlc_AVPlayerView:(WJVideoPlayView *)playerView currentPlayTimeChanged:(Float64)currentPlayTime;

@end



@interface WJVideoPlayView : UIView
@property (nonatomic, strong) NSURL *playerUrl;/**< 播放链接 */

@property (nonatomic, assign) id<XCAVPlayerDelegate> delegate;
@property (nonatomic, assign) Float64 currentPlayTime;/**< current play time */
@property (nonatomic, assign) Float64 totalDuration;/**< video duration */
@property (nonatomic, assign) Float64 timeInterval;/**< available Duration (cached) */

@property (nonatomic, assign) BOOL    isShowBottomProgressView;/**< default is YES */
@property (nonatomic, assign) BOOL    isShowResumViewAtPlayEnd;/**< default is YES */
@property (nonatomic, strong) UIButton *resumeBtn;

/** 单利对象 */
+ (WJVideoPlayView *)sharedPlayView;

/** 播放状态 */
- (BOOL)isPlaying;

/** play */
- (void)play;

/** pause */
- (void)pause;

/** resume */
- (void)resume;

/** 拉动进度条 */
- (void)seekToTime:(CGFloat)seekTime;

/** 播放时间 00:00:00 */
- (NSString *)convertTimeToString:(CGFloat)second;

/** 销毁View */
- (void)resetAVPlayer;
@end
